package service

import (
	"errors"
	"project1/db"
	"project1/dbmodel"
)

type CommService struct{}

// PostUser post写入mysql用户表参数
func (c *CommService) PostUser(body *dbmodel.User) (string, error) {
	body.Status = 1 // 默认正常
	err := db.GormDB.Create(body).Error
	if err != nil {
		return "", errors.New("插入失败")
	}
	return "插入成功", nil
}
